package gui.mainFrame.testConditionViewer.BasisPathViewer;

import gui.GUIController;
import org.jgraph.JGraph;
import org.jgraph.graph.GraphModel;
import org.jgrapht.ext.JGraphModelAdapter;
import org.jgrapht.graph.DefaultEdge;
import org.jgrapht.graph.ListenableDirectedGraph;

/**
 *
 * @author William
 */
public class BasisPathController
{

    private final GUIController control;
    private final JGraph graph;
    private final ListenableDirectedGraph g;

    public BasisPathController(GUIController control)
    {
        this.control = control;
        g = new ListenableDirectedGraph(DefaultEdge.class);

        GraphModel graphModel = new JGraphModelAdapter(g);
        graph = new JGraph(graphModel);

        //Add selection Listener to graph
        graph.addGraphSelectionListener(new GraphSelectionListenerImp(control));
      
    }

    public JGraph getJGraph()
    {
        return graph;
    }

    public void addConditionAtLevel(int level, String condition)
    {

        g.addVertex("v1");

    }

    public ListenableDirectedGraph getGraphModel()
    {
        return g;
    }
}
